package com.turato.observer.clean;


import com.google.gson.Gson;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;

/**
 * @author tuhao
 * @date 2021/2/9 5:41 下午
 * @desc
 */
public class AddScoreObserver implements UserRegisterObserver {
    private static final Logger LOGGER = LoggerFactory.getLogger(AddScoreObserver.class);
    private Gson gson = new Gson();

    @Override
    public void update(RegisterEvent event) {
        if (null == event || !StringUtils.hasLength(event.getInviteUserId())) {
            LOGGER.info("无效的消息,event:{}", gson.toJson(event));
        }
        LOGGER.info("给用户加积分,event:{}", gson.toJson(event));
    }
}
